Let's take a look at
the areas that you can review to identify and
troubleshoot performance issues. It's important to
monitor performance in the development phase
and in production. In development, add performance
tests your test suite to ensure that the performance of your application doesn't
degrade when you fix bugs, add new features, or change
underlying software. Response times and
resource requirements can change significantly when you make changes to your application. With performance tests,
you'll be able to detect and address performance issues early in the development process. In development, check
performance watch points related to incoming requests. A watch point is a potential
area of configuration or application code that could indicate a
performance issue. Performance issues maybe a result of multiple watch points. Review metrics related
to incoming requests, and check areas such as
the ones shown here. Review the design and
implementation of your webpages. You can use Page
Speed Insights to view information about the
lack of caching headers, the lack of compression, too many HTTP browser requests, slow DNS response, and
the lack of minification. If the application is
not public-facing, you can use Chrome Dev tools with Page Speed Insights to
manually analyze webpages. Check for self-inflicted load. This is load caused by
the application itself, such as service to service
or browser to service calls. For example, check for
pulling Cron jobs, batch requests, where multiple Ajax
requests from the browser. You can use client-side tools
such as Chrome Dev tools, server-side load
analysis tools such as Cloud Trace to find the
source of your problem. In development, review
application code and logs to check for
performance issues. Check logs for
application errors, such as HTTP errors
and exceptions. Identify the root cause of
the log messages and confirm that they are not related to periodic load or
performance issues. Prioritize investigation by
the frequency of errors. Because the state is historical, some errors might have been intermittent or already resolved. If a log message is
not reproducible, it might be better to
defer the investigation. Check for runtime co-generation. Aspect Oriented
Programming practices can sometimes cause reduced
application performance. Consider compile-time
co-generation, instead. Don't serve static resources
from your application. Instead, use a content
delivery network such as Cloud CDN with
Google Cloud Storage. Consider caching
frequently accessed values that are retrieved from a database or require significant compute
resources to recalculate. You can also cache generated HTML fragments
for later use. Look for areas where data is
retrieved from a database or service with multiple
requests and serial. Replace these individual
requests with a single batch request or send
the request and parallel. Don't retry constantly on errors, instead, retry with
exponential back off. Implement a circuit
breaker to stop retries after a certain
number of failures. Note that you should only retry in case of certain errors, such as connection timeouts
or too many requests. Don't retry in case
of errors like 5xx errors and
malformed URL errors. In production, monitor
incoming requests to check the following areas; external user load, analyze the most frequent requests
and slowest requests. Confirm that the
requests are expected. Determine the cause for
the slowest requests. Periodic load,
analyze traffic over an extended period of time to determine which periods have
higher levels of usage, confirmed that there is a
business reason for this load. Malicious load. Confirm that all load is expected
and legitimate. If you have a web application, make sure that all load is coming from a web or mobile client. You can further segment
the load by user to understand whether
the majority of requests are coming from
a small number of users. In production review, deployment settings
follows; scaling, makes sure that you've set up load balancing and
auto-scaling policies as appropriate for the traffic volumes
for your application. Set target utilization levels conservatively to ensure that your application
continues to handle traffic while new VM
instances come on line. Region. Determine where the bulk of your traffic is coming from, deploy resources in the appropriate regions
to reduce latency. Cron jobs. Make sure that your Cron jobs are
scheduled, accurately. Review and implement best
practices for each of the services that you are
using in your application. Remember, SREs stands for
Site Reliability Engineering. We have the queries flow
and the pages stay silent.